package com.xyz.dao.logic;

import com.free.ext.mybatis.model.entity.PageResponseModel;
import com.xyz.dao.dao.CCustomerfriendDao;
import com.xyz.domain.table.CCustomerfriend;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class CCustomerfriendLogic {

    @Autowired
    private CCustomerfriendDao cCustomerfriendDao;

    public CCustomerfriend add(CCustomerfriend cCustomerfriend){
        return cCustomerfriendDao.insert(cCustomerfriend);
    }

    public Integer update(CCustomerfriend cCustomerfriend){
        return cCustomerfriendDao.update(cCustomerfriend);
    }

    public List<CCustomerfriend> list(CCustomerfriend cCustomerfriend, String orderBy){
        return cCustomerfriendDao.selectList(cCustomerfriend, orderBy);
    }

    public Integer delete(Integer key){
        return cCustomerfriendDao.delete(key);
    }

    public PageResponseModel<CCustomerfriend> pageInfo(CCustomerfriend cCustomerfriend, String orderBy, Integer pageNo, Integer pageSize){
        return cCustomerfriendDao.selectByPageNo(cCustomerfriend, orderBy, pageNo, pageSize);
    }

}